<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>登录</title>
    <link rel="stylesheet" href="__ADMINS__component/pear/css/pear.css" />
    <link rel="stylesheet" href="__ADMINS__admin/css/other/login.css" />
    <link rel="stylesheet" href="__ADMINS__admin/css/variables.css" />
    <script>if (window.self != window.top) { top.location.reload();}</script>
</head>

<body>
<div class="login-page">
    <div class="layui-row">
        <div class="layui-col-sm6 login-bg layui-hide-xs">
            <img class="login-bg-img" src="__ADMINS__admin/images/banner.png" alt="" />
        </div>
        <div class="layui-col-sm6 layui-col-xs12 login-form">
            <div class="layui-form">
                <div class="form-center">
                    <div class="form-center-box">
                        <div class="top-log-title">
                            <img class="top-log" src="__ADMINS__admin/images/logo.png" alt="" />
                            <span>Mortal Admin 1.0</span>
                        </div>
                        <div class="top-desc">
                            我 们 不 是 最 好 但 愿 更 好
                        </div>
                        <div style="margin-top: 30px;">
                            <input type="hidden" name="__token__" value="{$Request.token}" />
                            <div class="layui-form-item">
                                <div class="layui-input-wrap">
                                    <div class="layui-input-prefix">
                                        <i class="layui-icon layui-icon-username"></i>
                                    </div>
                                    <input lay-verify="required" placeholder="账户" name="account" autocomplete="off" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <div class="layui-input-wrap">
                                    <div class="layui-input-prefix">
                                        <i class="layui-icon layui-icon-password"></i>
                                    </div>
                                    <input type="password" name="password" value="" lay-verify="required" placeholder="密码" autocomplete="off" class="layui-input" lay-affix="eye">
                                </div>
                            </div>
                            {if(get_s_c('google_auth')&&(get_s_c('google_auth') == 1))}
                            <div class="layui-form-item">
                                <div class="layui-input-wrap">
                                    <div class="layui-input-prefix">
                                        <i class="layui-icon layui-icon-password"></i>
                                    </div>
                                    <input placeholder="谷歌验证码-未绑定请留空" name="google_code" autocomplete="off" class="layui-input">
                                </div>
                            </div>
                            {/if}
                            <div class="tab-log-verification">
                                <div class="verification-text">
                                    <div class="layui-input-wrap">
                                        <div class="layui-input-prefix">
                                            <i class="layui-icon layui-icon-auz"></i>
                                        </div>
                                        <input lay-verify="required" value="" placeholder="验证码" autocomplete="off" class="layui-input" name="v_code">
                                    </div>
                                </div>
                                <img src="{:captcha_src()}" alt="" class="verification-img" onClick="this.src=this.src+'?'+Math.random()"/>
                            </div>
                            <div class="layui-form-item">
                                <div class="remember-passsword">

                                </div>
                            </div>
                            <div class="login-btn">
                                <button type="button" lay-submit lay-filter="login" class="layui-btn login">登 录</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- 资 源 引 入 -->
<script src="__ADMINS__component/layui/layui.js"></script>
<script src="__ADMINS__component/pear/pear.js"></script>
<script>
    layui.use(['form', 'button', 'popup','toast'], function () {
        var $ = layui.$;
        var form = layui.form;
        var toast = layui.toast;
        var button = layui.button;
        var popup = layui.popup;

        // 登 录 提 交
        form.on('submit(login)', function (data) {
            button.load({
                elem: '.login',
                time: 1500,
                done: function () {
                    $.post('{:url("admin/login/do_login")}',data.field,function(res){
                        if(res.code === 200){
                            popup.success(res.msg, function () {
                                location.href = '{:url("admin/index/index")}'
                            });
                        }else{
                            toast.error({
                                message: res.msg,
                            });
                            $("#v_code_img").click();
                        }
                    })
                }
            })
            return false;
        });
    })
</script>
</body>

</html>
